package com.cqjtu.tto.handler;

import com.cqjtu.tto.vo.Results;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author：monkey-L
 * @description:
 * @date: 18:12 2021/12/12
 */
@ControllerAdvice
public class AllExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody   //返回json数据
    public Results doException(Exception e){
        e.printStackTrace();
        return Results.fail(-999,"系统异常");
    }
}
